package com.rc.saas.tenant.service.enterprise;

import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.mapper.enterprise.EnterpriseMemberMapper;
import com.rc.saas.tenant.model.enterprise.EnterpriseMember;
import com.rc.saas.tenant.model.enterprise.EnterpriseMemberExample;
import com.rc.saas.tenant.model.enterprise.EnterpriseSubmember;
import com.rc.saas.tenant.model.enterprise.EnterpriseSubmemberShare;
import com.rc.saas.tenant.model.tenant.TenantUser;
import com.rc.saas.tenant.search.enterprise.EnterpriseMemberSearch;
import com.rc.saas.tenant.vo.enterprise.EnterpriseMemberPrintVo;
import com.rc.saas.tenant.vo.enterprise.EnterpriseMemberResult;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author frog
 * @date 2019/9/25
 */
public interface EnterpriseMemberService extends BaseService<Long, EnterpriseMember, EnterpriseMemberExample, EnterpriseMemberMapper> {
    Long insertReturnId(EnterpriseMember enterpriseMember);

    TResponse resetPassword(TenantUser tenantUser,String password);

    TResponse insertOneEnterpriseSubmember(String mobile, Long enterpriseId, TenantUser user);

    TResponse insertBatchEnterpriseSubmember(String batchMobile, Long enterpriseId, TenantUser user);

    TResponse saveEnterpriseShare(EnterpriseSubmemberShare enterpriseSubmemberShare);

    /**
     * 通过迁移ID查询会员
     */
    EnterpriseMember selectEnterpriseMemberByMigrateId(String tenantCode, Long migrateId);

    EnterpriseMember selectMemberByMobile(String tenantCode, String enterpriseMobile);

    List<EnterpriseSubmember> selectAllSubmemberByEnterpriseId(Long enterpriseId);

    TResponse saveSubmemberShare(EnterpriseSubmemberShare enterpriseSubmemberShare);

    EnterpriseMember selectMemberByMemberId(Long memberId);

    List<EnterpriseMemberPrintVo> exportEnterpriseMember(EnterpriseMemberSearch enterpriseMemberSearch);

    PageInfo<EnterpriseMemberResult> listPageEnterpriseMember(EnterpriseMemberSearch search);

    TResponse updateStatus(Long memberId);

    List<EnterpriseMember> selectEnterpriseMembers(String tenantCode);

    void updateEnterpriseForRecharge(Long enterpriseId, BigDecimal money);

    void updateEnterpriseForCredit(Long enterpriseId, BigDecimal creditAmount);
}
